// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Axios from 'axios';

import Vuex from 'Vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
  // ...组件间共享的数据都要定义在此处
  state:{
    count:1000
  },
  //修改state中的数据的方法，只能定义在mutations
  mutations:{
    add(state,a){
      state.count++;
    },
    jian(state,a){
      state.count--;
    }
  }
})

Vue.config.productionTip = false
//配置axios，给Vue添加一个axios属性
Vue.prototype.axios = Axios
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
